package com.example.demo.thread.create;

/**
 * 创建线程的七种方式
 * https://blog.csdn.net/CYK_byte/article/details/128856566
 *
 * @author MarioZzz
 * @create 2023-10-24 18:30
 */
public class MainA {
    public static void main(String[] args) {
        System.out.println("Main 线程名称 ======"+ Thread.currentThread().getName()) ;
        MyThread myThread = new MyThread();
        myThread.start();
    }
}

/**
 * 1 继承Thread，重写run方法
 */
class MyThread extends Thread {
    @Override
    public void run() {
        System.out.println("Main 线程创建了新的线程NAME======"+ Thread.currentThread().getName()) ;
        System.out.println("继承Thread，重写run方法创建线程");
    }
}

